/**
 * Copyright (C) 2013 Denatics Development
 *
 * Programmed by David Tiersch <dtiersch@denatics.com>
 *
 * This file is part of B0mberman.
 *
 * B0mberman is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * B0mberman is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with B0mberman. If not, see <http://www.gnu.org/licenses/>.
 */
package com.denatics.bomberman.entities;

import com.denatics.bomberman.Features;

/**
 * Skeleton for all Entitys in the Game-World.
 *
 * @author David Tiersch <dtiersch@denatics.com>
 */
public abstract class Entity {

    /**
     * Indicates if the Entity blocks other Objects.
     */
    private boolean solid;

    /**
     * Indicates if the Entity can be destroyed.
     */
    private boolean destructable;

    /**
     * Indicates if portals can be applied to this Entity.
     */
    private boolean portalable;

    /**
     * Shows whether this Entity blocks other Objects.
     *
     * @return true, if other Objects are being blocked.
     */
    public final boolean isSolid() {
        return this.solid;
    }

    /**
     * Shows whether this Entity can be destroyed.
     *
     * @return true, if this Entity can be destroyed
     */
    public final boolean isDestructable() {
        return this.destructable;
    }

    /**
     * Shows wheter portals can be placed on this Entity.
     *
     * @return true, if portals can be placed
     */
    public final boolean isPortalable() {
        return this.portalable && Features.PORTALS.enabled();
    }

    /**
     * Changes the Solidness.
     *
     * @param newValue
     *            indicates if the Entity blocks other Entities
     */
    protected final void setSolid(final boolean newValue) {
        this.solid = newValue;
    }

    /**
     * Changes the Destructibility.
     *
     * @param newValue
     *            indicates if the Entity can be destroyed.
     */
    protected final void setDestructable(final boolean newValue) {
        this.destructable = newValue;
    }

    /**
     * Changes the Ability whether portals can be placed on this Entity.
     *
     * @param newValue
     *            indicates if portals can be applied to this Entity.
     */
    protected final void setPortalable(final boolean newValue) {
        this.portalable = newValue;
    }

    /**
     * Indicates the Type of the Entity.
     *
     * @return Type of the Entity
     */
    public abstract EntityType getType();

    /**
     * Returns the position of the graphics of this Entity in the Texture-File.
     *
     * @return position of the Texture
     */
    public abstract int[] getTexPosition();
}
